//
//  RecommendTableViewCell.m
//  Happy Kitchen
//
//  Created by mac_chen on 15/3/14.
//  Copyright (c) 2015年 mac_chen. All rights reserved.
//

#import "RecommendTableViewCell.h"

@implementation RecommendTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
    }
    return self;
}


- (void)createSubviews
{
    
    //食品图片imageView
    self.FoodImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.frame.origin.x + 15, self.frame.origin.y + 5, self.frame.size.width / 3, self.frame.size.height + 45)];
    
//    self.FoodImageView.backgroundColor = [UIColor redColor];
    
    [self.contentView addSubview:self.FoodImageView];

    
    //食品名称label
    self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.FoodImageView.frame.origin.x + self.FoodImageView.frame.size.width + 20, self.FoodImageView.frame.origin.y, self.frame.size.width / 2, self.FoodImageView.frame.size.height / 4)];
    
    self.nameLabel.font = [UIFont systemFontOfSize:15.0];
    
//    self.nameLabel.backgroundColor = [UIColor redColor];
    
    [self addSubview:self.nameLabel];
    

    
    //功效
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(self.nameLabel.frame.origin.x, self.nameLabel.frame.origin.y + self.nameLabel.frame.size.height + 10, 40, 20)];
    
    label.text = @"功效 :";
    
    label.font = [UIFont systemFontOfSize:15.0];
    [self addSubview:label];
    
    //功效label
    self.effectLabel = [[UILabel alloc] initWithFrame:CGRectMake(label.frame.origin.x + label.frame.size.width + 5, label.frame.origin.y, 60, 20)];
//    self.effectLabel.backgroundColor = [UIColor redColor];
//    self.effectLabel.text = @"开胃";
    self.effectLabel.font = [UIFont systemFontOfSize:15.0];
    [self addSubview:self.effectLabel];
    
    
    
    
    //点击图标
    UIImageView *clickImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.nameLabel.frame.origin.x - 9, label.frame.origin.y + label.frame.size.height, label.frame.size.width + 1, self.nameLabel.frame.size.height + 10)];
    
    clickImageView.image = [UIImage imageNamed:@"click.png"];
    
    [self addSubview:clickImageView];
    
    //点击量label
    self.clickLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.effectLabel.frame.origin.x - 15, self.effectLabel.frame.origin.y + 26, 31, self.nameLabel.frame.size.height)];
    
//    self.clickLabel.backgroundColor = [UIColor redColor];
    self.clickLabel.font = [UIFont systemFontOfSize:13.0];
    
    //    self.clickLabel.backgroundColor = [UIColor blueColor];
    [self.contentView addSubview:self.clickLabel];
}







- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
